package com.sdonkey.score.model;

import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.List;

public class EditPlaceAdBean {
	
	private String adId;
	
	private String adName;
	
	private String adHomePage;

	private String beginTime;
	
	private String endTime;

	private String   releaseMount;
	  
	private String deliveryPrice;
	  
	private String deliveryCarrier;

	private String carrierPrice;

	//娓犻亾淇℃伅:娓犻亾ID_鎶曟斁鎬婚_鍗曚环|娓犻亾ID_鎶曟斁鎬婚_鍗曚环
	private String  channelInfo;
	
	private String channelAmount;
	
	private String channelPrice;

	private String country;
	
	private String area;
	
	//鐩爣浜虹兢锛氭�у埆锝滃鍚︼綔鏈夋棤瀛╁瓙锝滄槸鍚︽湁鎴匡綔鏄惁鏈夎溅锝滃勾榫勶綔瀛﹀巻锝滄湀鏀跺叆锝滃搴敹鍏�
	private  String targetInfo; 
	
	//骞垮憡鍒嗙被锛�
	private String adTag;
	
	private String hobbyTag;
	
	private String userId;
	
	private String status;
	
	private String  mbPrice;
	
	private String  pcPrice;
	
	private String  padPrice;
	
	private String  tvPrice;
		
	//鍦板尯淇℃伅:all(part)|鍗庡寳锛屽寳鍗楋綔鍖椾含锛屽箍涓�
	private String  areaInfo;
	
	
	private List<ChannelInfoBean>  channelInfos;

	
	
	
	public List<ChannelInfoBean> getChannelInfos() {
		return channelInfos;
	}

	public void setChannelInfos(List<ChannelInfoBean> channelInfos) {
		this.channelInfos = channelInfos;
	}

	public String getDeliveryCarrier() {
		return deliveryCarrier;
	}

	public void setDeliveryCarrier(String deliveryCarrier) {
		this.deliveryCarrier = deliveryCarrier;
	}

	public String getCarrierPrice() {
		return carrierPrice;
	}

	public void setCarrierPrice(String carrierPrice) {
		this.carrierPrice = carrierPrice;
	}

	public String getChannelAmount() {
		return channelAmount;
	}

	public void setChannelAmount(String channelAmount) {
		this.channelAmount = channelAmount;
	}

	public String getChannelPrice() {
		return channelPrice;
	}

	public void setChannelPrice(String channelPrice) {
		this.channelPrice = channelPrice;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getMbPrice() {
		return mbPrice;
	}

	public void setMbPrice(String mbPrice) {
		this.mbPrice = mbPrice;
	}

	public String getPcPrice() {
		return pcPrice;
	}

	public void setPcPrice(String pcPrice) {
		this.pcPrice = pcPrice;
	}

	public String getPadPrice() {
		return padPrice;
	}

	public void setPadPrice(String padPrice) {
		this.padPrice = padPrice;
	}

	public String getTvPrice() {
		return tvPrice;
	}

	public void setTvPrice(String tvPrice) {
		this.tvPrice = tvPrice;
	}

	public String getChannelInfo() {
		return channelInfo;
	}

	public void setChannelInfo(String channelInfo) {
		this.channelInfo = channelInfo;
	}

	public String getAreaInfo() {
		return areaInfo;
	}

	public void setAreaInfo(String areaInfo) {
		this.areaInfo = areaInfo;
	}

	public String getTargetInfo() {
		return targetInfo;
	}

	public void setTargetInfo(String targetInfo) {
		this.targetInfo = targetInfo;
	}

	public String getAdTag() {
		return adTag;
	}

	public void setAdTag(String adTag) {
		this.adTag = adTag;
	}

	public String getHobbyTag() {
		return hobbyTag;
	}

	public void setHobbyTag(String hobbyTag) {
		this.hobbyTag = hobbyTag;
	}
	
	  public String getAdId() {
		return adId;
	}

	public void setAdId(String adId) {
		this.adId = adId;
	}

	public String getReleaseMount() {
		return releaseMount;
	}

	public void setReleaseMount(String releaseMount) {
		this.releaseMount = releaseMount;
	}

	public String getDeliveryPrice() {
		return deliveryPrice;
	}

	public void setDeliveryPrice(String deliveryPrice) {
		this.deliveryPrice = deliveryPrice;
	}
	
	
public String getAdName() {
	return adName;
}

public void setAdName(String adName) {
	this.adName = adName;
}

public String getAdHomePage() {
	return adHomePage;
}

public void setAdHomePage(String adHomePage) {
	this.adHomePage = adHomePage;
}

/*public void transfer(){
	if(StringUtils.isNotBlank(this.carrierPrice)){
		this.carrierPrice = carrierPrice.replace("null", " ");
		String[]  prices = this.carrierPrice.split("\\|");	
		if(prices.length == 4){
			this.mbPrice=prices[0];
			this.pcPrice=prices[1];
			this.padPrice=prices[2];
			this.tvPrice=prices[3];
		}
		
		this.adHomePage = FileUploadTool.SHOW_IMG_PRE+this.adHomePage;

		}		
	}*/


public void transferChannels(List<ChannelBean> channelBeans ){
		if(StringUtils.isNotBlank(this.channelInfo)){
			List<ChannelInfoBean> channelInfos = new ArrayList<ChannelInfoBean>();
			String[]  channels = this.channelInfo.split("\\|");	
			for(String channel : channels){
				ChannelInfoBean channelInfoBean = new ChannelInfoBean();
				String[] strs =channel.split("_");
				if(strs.length  !=  3){
					break;
				}
				channelInfoBean.setId(strs[0]);
				channelInfoBean.setTotal(strs[1]);
				channelInfoBean.setPrice(strs[2]);		
				for(ChannelBean channelBean:channelBeans ){
					if(strs[0].equals(channelBean.getId())){
						channelInfoBean.setName(channelBean.getName());
						channelInfoBean.setLogoUrl(channelBean.getLogoUrl());
						continue;
					}
				}
				channelInfos.add(channelInfoBean);
			}		
			
			this.channelInfos = channelInfos;
		}		
	}



//鐩爣浜虹兢锛氳鎯�  鎬у埆锝滃鍚︼綔鏈夋棤瀛╁瓙锝滄槸鍚︽湁鎴匡綔鏄惁鏈夎溅锝滃勾榫勶綔瀛﹀巻锝滄湀鏀跺叆锝滃搴敹鍏�

private String sex;

private String hun;

private String boy;

private String hourse;

private String car;

private String age;

private String education;

private String  monthCom;

private String family;

private String adKey;


public String getSex() {
	return sex;
}

public String getHun() {
	return hun;
}

public String getBoy() {
	return boy;
}

public String getHourse() {
	return hourse;
}

public String getCar() {
	return car;
}

public String getAge() {
	return age;
}

public String getEducation() {
	return education;
}

public String getMonthCom() {
	return monthCom;
}

public String getFamily() {
	return family;
}

public void setSex(String sex) {
	this.sex = sex;
}

public void setHun(String hun) {
	this.hun = hun;
}

public void setBoy(String boy) {
	this.boy = boy;
}

public void setHourse(String hourse) {
	this.hourse = hourse;
}

public void setCar(String car) {
	this.car = car;
}

public void setAge(String age) {
	this.age = age;
}

public void setEducation(String education) {
	this.education = education;
}

public void setMonthCom(String monthCom) {
	this.monthCom = monthCom;
}

public void setFamily(String family) {
	this.family = family;
}

public void transferTargetInfo(){
	if(StringUtils.isNotBlank(this.targetInfo)){
		String[]  prices = this.targetInfo.split("\\|");	
		if(prices.length == 9){
			this.sex=prices[0];
			this.hun=prices[1];
			this.boy=prices[2];
			this.hourse=prices[3];
			this.car=prices[4];
			this.age=prices[5];
			this.education=prices[6];
			this.monthCom=prices[7];
			this.family=prices[8];
		}
		}		
	}

public void transfer() {
	// TODO Auto-generated method stub
	
}

public String getAdKey() {
	return adKey;
}

public void setAdKey(String adKey) {
	this.adKey = adKey;
}


}





